package com.qf.controller;

import com.qf.service.Impl.CityServiceImpl;

import com.qfedu.vo.ResultVo;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@CrossOrigin
public class CityController {

    @Resource
    private CityServiceImpl cityService;


    @RequestMapping("getSonCitys/{cid}")
    public ResultVo getSonCitys(@PathVariable("cid") Integer cid){
          return cityService.getSonCitys(cid);
    }

    @RequestMapping("getHotCitys/{start}/{end}")
    public ResultVo getHotCitys(@PathVariable("start") Integer start,@PathVariable("end") Integer end) {
        return cityService.getHotCitys(start, end);
    }


    @RequestMapping("getCityByCid/{cid}")
    ResultVo getCityByCid(@PathVariable("cid") Integer cid){
        return cityService.getCityByCid(cid);
    }

}
